package com.example.chapter2;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.TextView;

 /**
  * Main->Red->Blue->Red
  * Main<-Red<-Blue<-Red
  * @author songsungkyun
  *
  */
public class RedActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_red);
        
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
    
    public void button_pressed(View view) {
//    	Intent intent = new Intent(this, BlueActivity.class);
//    	this.startActivity(intent);
    	
    	Intent intent = new Intent();
    	intent.putExtra("result", "Done.");
    	this.setResult(RESULT_OK, intent);
    	this.finish();
    }
}